<!-- Generated automatically from an XML file of the same name.
     Copyright: Stephen J. Sangwine and Nicolas Le Bihan, 2008-2011.
--><html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
   <title>svd :: Functions (Quaternion Toolbox Function Reference)
</title><link rel="stylesheet" href="qtfmstyle.css" type="text/css"></head><body><h1>Quaternion Function Reference</h1><h2>svd</h2>
<p>Singular value decomposition<br>(Quaternion overloading of standard MATLAB&reg; function)
</p>
<h2>Syntax</h2><p><tt>[U,S,V] = svd(X, econ)</tt></p>
<h2>Description</h2>
<p>
<tt>svd</tt> computes the quaternion singular value decomposition. This
decomposition generalises from the case of real and complex matrices. The
singular values are real (even in the case of a complex quaternion matrix),
and the singular vectors are quaternion-valued (complex quaternion-valued
in the case of a complex quaternion matrix).
Thus <tt>U</tt> and <tt>V</tt> are unitary quaternion matrices, and
<tt>S</tt> is a real diagonal matrix.
</p>

<h2>Examples</h2>Construct a matrix at random, decompose it, and show that the
matrix can be reconstructed from the decomposition, to within rounding
error:
<pre>
&gt;&gt; q = randq(4)
 
q = 4x4 quaternion array
 
&gt;&gt; [U, S, V] = svd(q)
 
U = 4x4 quaternion array
 
S =

    3.0473         0         0         0
         0    2.1201         0         0
         0         0    1.3996         0
         0         0         0    0.5104

V = 4x4 quaternion array
 
&gt;&gt; U * S * V' - q
 
ans = 4x4 quaternion array
 
&gt;&gt; max(max(abs(ans)))

ans = 1.8660e-15
</pre>
Similarly with a complex quaternion matrix (note the double use of <tt>abs</tt>
when checking the reconstruction - because the modulus of a complex
quaternion is complex it is necessary to take the modulus of the modulus
so that the maximum can be found):
<pre>
&gt;&gt; q = complex(randq(4), randq(4)) .* randn(4)
 
q = 4x4 complex quaternion array
 
&gt;&gt; [U, S, V] = svd(q)
 
U = 4x4 complex quaternion array
 
S =

    6.9636         0         0         0
         0    2.8856         0         0
         0         0    1.9821         0
         0         0         0    0.5788

V = 4x4 complex quaternion array
 
&gt;&gt; U * S * V' - q
 
ans = 4x4 complex quaternion array
 
&gt;&gt; max(max(abs(abs(ans))))

ans = 6.8965e-13
</pre>

<h2>See Also</h2>QTFM function: <a href="svdj.html">svdj</a><br>MATLAB&reg; function: <a href="matlab:doc svd">svd</a><br>
<h2>References</h2><ol><li>F. Z. Zhang,
'Quaternions and Matrices of Quaternions',
<i>Linear Algebra and its Applications</i>,
<b>251</b>, January 1997, 21-57.

DOI: <a href="http://dx.doi.org/10.1016/0024-3795(95)00543-9">10.1016/0024-3795(95)00543-9</a>
</li><li>S. J. Sangwine and N. Le Bihan,
'Quaternion Singular Value Decomposition based on Bidiagonalization
to a Real or Complex Matrix using Quaternion Householder Transformations',
<i>Applied Mathematics and Computation</i>,
<b>182</b> (1), 1 November 2006, 727-738.

DOI: <a href="http://dx.doi.org/10.1016/j.amc.2006.04.032">10.1016/j.amc.2006.04.032</a>.
</li><li>S. J. Sangwine and N. Le Bihan,
'Quaternion Singular Value Decomposition based on Bidiagonalization
to a Real Matrix using Quaternion Householder Transformations',
arXiv:math.NA/0603251, 10 March 2006.
Available at <a href="http://www.arxiv.org/">http://www.arxiv.org/</a>.
</li></ol>
<h4>&copy; 2008-2011 Stephen J. Sangwine and Nicolas Le Bihan</h4><p><a href="license.html">License terms.</a></p></body></html>